package cn.denvie.agent.logger;

import java.util.logging.Logger;

/**
 * 控制台日志。
 *
 * @author DengZhaoyong
 * @version 1.0.0
 */
public class JclLogger implements ILogger {

    private static Logger DEFAULT = Logger.getLogger(JclLogger.class.getName());

    private Logger logger;

    public JclLogger() {
        logger = DEFAULT;
    }

    public JclLogger(String name) {
        this.logger = Logger.getLogger(name);
    }

    @Override
    public void info(Object content) {
        if (content == null) {
            content = "";
        }
        logger.info(content.toString());
    }

    @Override
    public void error(Object content) {
        if (content == null) {
            content = "";
        }
        logger.severe(content.toString());
    }

}